package com.zxp.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zxp.server.dto.BlogInfo;
import com.zxp.server.vo.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 朱小皮
 * @since 2022-05-14
 */
@Mapper
public interface BlogMapper extends BaseMapper<Blog> {

    IPage<BlogInfo> getBlogInfo(@Param("page") Page<BlogInfo> page,@Param("blog")Blog blog);

    BlogInfo getBlogInfoById(@Param("id")Integer id );

    IPage<BlogInfo> getReleaseBlogInfoByUser(@Param("page") Page<BlogInfo> page,@Param("uid") Integer uid);

    IPage<BlogInfo> getDraftBlogInfoByUser(@Param("page") Page<BlogInfo> page,
                                           @Param("uid") Integer uid,
                                           @Param("flag")Integer flag,
                                           @Param("blog")Blog blog);


    IPage<BlogInfo> getSpecialList(@Param("page") Page<BlogInfo> page, @Param("tagId") Integer tagId);
}
